package com.example.demofdfs.test2;

import java.util.Arrays;
import java.util.Collection;
import java.util.Map;
import java.util.Properties;
import java.util.Set;

public class SystemTest {

	public static void main(String[] args) {
//		new SystemTest().test1();
//		new SystemTest().test_2();
		new SystemTest().test_3();
	}

	
	public void test_3() {
		String value = System.getProperty("java.class.path");
//		System.out.println(value);
		for (String s : value.split(";")) {
			System.out.println(s);
		}
	}
	
	public void test_2() {
		Map<String, String> envs = System.getenv();
		System.out.println(envs);
		Set<String> keys = envs.keySet();
		Collection<String> collection = envs.values();
		System.out.println(keys);
		System.out.println(collection);
		System.out.println(envs.getClass());
		envs.forEach((k, v)-> System.out.println(k + " = " + v));
		System.out.println("\n=========================================\n");
		
		Properties prop = System.getProperties();
		prop.forEach((k, v)-> System.out.println(k + " = " + v));
	}
	
	public void test1() {
		Object[] objects = new Object[10];
		objects[0] = new Foo(1);
		System.out.println(Arrays.toString(objects));
		
		System.arraycopy(objects, 0, objects, 1, 1);
		System.out.println(Arrays.toString(objects));
		
		System.arraycopy(objects, 0, objects, 2, 3);
		System.out.println(Arrays.toString(objects));
		
		System.arraycopy(objects, 0, objects, 7, 3);
		System.out.println(Arrays.toString(objects));
		
	}
	
	private static class Foo {
		public Foo(int id) {
			this.id = id;
		}
		private int id;
		@Override
		public String toString() {
			return Integer.toString(id);
		}
		
		
	}
}
